﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/MasterPage.master" AutoEventWireup="true"
    CodeFile="test.aspx.cs" Inherits="test" Title="无标题页" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <%--.ListSearchExtenderPrompt
{
	font-style:italic;
	color:Gray;
	background-color:white;
}--%>

    <script language="javascript" type="text/javascript">
      function selectAll()
	  {
		var a = document.getElementsByTagName("input");
		var all = document.getElementById("alls");
		for (var i=0; i<a.length; i++)
		{
		 if(all.checked)
		 {
		    if (a[i].type == "checkbox") 
		    {
		         a[i].checked = true;
		    }
		 }
		 else
		 {
		    if (a[i].type == "checkbox") 
		    {
		         a[i].checked = false;
		    }
		    
		 }		 
		
		}
		
	}
	function cancelAll()
	{
		var a = document.getElementsByTagName("input");
		for (var i=0; i<a.length; i++)
		{
		    if (a[i].type == "checkbox") 
		    {
		       a[i].checked = false;
		    }
		}
	}    
   
    </script>
    
    <script type="text/javascript">
         var last = null;//最后访问的RadioButton的ID
         function judge(obj)
        {
             if(last == null)
            {
                 last = obj.id;
            //      alert(last);
             }
             else
            {
                 var lo = document.getElementById(last);
                 lo.checked = "";
          //        alert(last + "   " + lo.checked);
                 last = obj.name;
             }
             obj.checked = "checked";
         }
     </script>


    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        <asp:Label ID="lblTest" runat="server"></asp:Label>
            <asp:GridView ID="gvPurview" runat="server" AllowPaging="True" PageSize="10" AutoGenerateColumns="false"
                Width="100%" AllowSorting="true" PagerSettings-Mode="NumericFirstLast" OnPageIndexChanging="gvPurview_PageIndexChanging"
                OnRowCommand="gvPurview_RowCommand" OnSorting="gvPurview_Sorting" OnRowCancelingEdit="gvPurview_RowCancelingEdit"
                OnRowEditing="gvPurview_RowEditing" OnRowUpdating="gvPurview_RowUpdating" 
                onrowdatabound="gvPurview_RowDataBound">
                <PagerTemplate>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <asp:Label ID="lblPerPage" runat="server" Text="页次"></asp:Label>:&nbsp;<asp:Label
                                    ID="Label1" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex+1      %>'></asp:Label>/<asp:Label
                                        ID="Label2" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount %>'></asp:Label><asp:Label
                                            ID="lblPage" runat="server" Text="页"></asp:Label>&nbsp;
                                <asp:Label ID="lblTotalPages" runat="server" Text="总计"></asp:Label>:&nbsp;<asp:Label
                                    ID="Label3" runat="server" Text="<%# ((System.Data.DataView)gvPurview.DataSource).Count %>"></asp:Label>
                            </td>
                            <td align="right">
                                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Page" CommandArgument="First"
                                    Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>" Text="首页"></asp:LinkButton>
                                <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument="Prev" CommandName="Page"
                                    Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>" Text="前页"></asp:LinkButton>
                                <asp:LinkButton ID="LinkButton3" runat="server" CommandName="Page" CommandArgument="Next"
                                    Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>"
                                    Text="后页"></asp:LinkButton>
                                <asp:LinkButton ID="LinkButton4" runat="server" CommandArgument="Last" CommandName="Page"
                                    Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>"
                                    Text="尾页"></asp:LinkButton>&nbsp;
                                <asp:Label ID="lblTurnOn" runat="server" Text="转第"></asp:Label><%--<asp:DropDownList ID="ddlGotoPage" AutoPostBack="true" runat="server" OnSelectedIndexChanged="GoPage_TextChanged"
                                        SelectedValue="<%# ((GridView)Container.Parent.Parent).PageIndex+1 %>" DataSource="<%# CreatSource(1,((GridView)Container.Parent.Parent).PageCount) %>">
                                    </asp:DropDownList>--%>
                                <asp:TextBox ID="txtPages" runat="server" Width="35px"></asp:TextBox>
                                <asp:Label ID="lblPages2" runat="server" Text="页"></asp:Label>
                                <asp:LinkButton ID="lbtnGo" runat="server" Text="提交" OnClick="lbtnGo_Click"></asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                </PagerTemplate>
                <Columns>
                    <asp:TemplateField>
                    <ItemTemplate>
                    <asp:RadioButton ID="radiobutton1" runat="server" 
                            oncheckedchanged="radiobutton1_CheckedChanged" AutoPostBack="true" />
                    <asp:HiddenField ID="hidValue" runat="server" Value='<%# Eval("PurviewID")%>' />
                    </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="权限名" SortExpression="PurviewName">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtPurviewName" runat="server" Text='<%# Eval("PurviewName")%>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblPurviewName" runat="server" Text='<%# Eval("PurviewName")%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="权限码" SortExpression="PurviewCode">
                        <ItemTemplate>
                            <asp:Label ID="lblPurviewCode" runat="server" Text='<%# Eval("PurviewCode")%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="权限组名称" SortExpression="PurviewGroupName">
                        <ItemTemplate>
                            <asp:Label ID="lblPurviewGroupName" runat="server" Text='<%# Eval("PurviewGroupName")%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="权限分组码" SortExpression="PurviewGroupCode">
                        <ItemTemplate>
                            <asp:Label ID="lblPurviewGroupCode" runat="server" Text='<%# Eval("PurviewGroupCode")%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="编辑">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtnEditSuitOrders" CommandName="Edit" runat="server" Text="编辑"></asp:LinkButton>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:LinkButton ID="lbtnUpdate" CommandName="Update" runat="server" ValidationGroup="updateList"
                                Text="更新"></asp:LinkButton>
                            <asp:LinkButton ID="lbtnCancel" CommandName="Cancel" runat="server" Text="取消"></asp:LinkButton>
                        </EditItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle HorizontalAlign="Center" />
                <PagerSettings Mode="NumericFirstLast" />
                <RowStyle HorizontalAlign="Center" />
            </asp:GridView>
            <asp:Button ID="dds" runat="server" Text="test" OnClick="dds_Click" /><asp:Calendar
                ID="Calendar1" runat="server" DayNameFormat="Full"></asp:Calendar>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div>
        <asp:DropDownList ID="DropDownList1" runat="server" Width="100px" />
        <ajaxToolkit:ListSearchExtender ID="ListSearchExtender2" runat="server" TargetControlID="DropDownList1"
            PromptCssClass="ListSearchExtenderPrompt">
        </ajaxToolkit:ListSearchExtender>
    </div>
</asp:Content>
